import http from '../util/http.js';

export default {

    getPurchaseList:()=>{
        return http({
            method:"get",
            url:"api/purchase/list"
        })
    },
    getPurchasePage:(page)=>{
        return http({
            method:"get",
            url:"api/purchase/page",
            params:page
        });
    },

    deletePurchase: (Pid) => {
        return http({
            method: "delete",
            url: "api/purchase/delete/" + Pid
        });
    },
    addPurchase:(obj)=>{
        return http({
            method:"post",
            url:"api/purchase/add",
            data:obj,
            headers: {
                'Content-Type': 'application/json'
            }
        });
    },
    editPurchase:(obj)=>{
        return http({
            method:"put",
            url:"api/purchase/update",
            data:obj,
            headers: {
                'Content-Type': 'application/json'
            }
        });
    },
}